package au.com.langdale.gwt.client.pump;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.ServiceDefTarget;

/**
 * Utility class for simplifing access to the instance of PumpAsync service.
 */
public class PumpFactory {
	private static PumpAsync instance;
	public static PumpAsync getInstance(){
		if (instance == null) {
			instance = (PumpAsync) GWT.create(Pump.class);
			ServiceDefTarget target = (ServiceDefTarget) instance;
			target.setServiceEntryPoint(GWT.getModuleBaseURL() + "/Pump");
		}
		return instance;
	}
}